﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Frogs.Stability.LeakyBucket
{
	/// <summary>
	/// Event for bucket timer elapsing
	/// </summary>
	/// <param name="sender"></param>
	/// <param name="args"></param>
	public delegate void BucketTimerElapsedEventHandler(object sender, EventArgs args);

	/// <summary>
	/// Base definition of a bucket timer
	/// </summary>
	public interface IBucketTimer
	{
		/// <summary>
		/// Start the timer
		/// </summary>
		void Start();

		/// <summary>
		/// Stop the timer
		/// </summary>
		void Stop();

		/// <summary>
		/// Gets or sets the interval for the timer
		/// </summary>
		double Interval { get; set; }

		/// <summary>
		/// Event fired when timer elapses
		/// </summary>
		event BucketTimerElapsedEventHandler Elapsed;
	}
}
